﻿@using KL.Store.Core
@model KL.Store.Web.Models.OrderModel
<div class="content">
    <h1>Siparişlerim</h1>
    @if (Model.Orders.Count > 0)
    {
        <div class="cart-info">
            <div class="shop-cart-orders">
                <table class="table table-bordered">
                    <thead>
                        <tr>
                            <td class="name col-xs-1" style="width: 40px">Sipariş No
                            </td>
                            <td class="name col-xs-2">Sipariş Tarihi
                            </td>
                            <td class="name col-xs-3" style="width: 90px">Ürün Durumu
                            </td>
                            <td class="name col-xs-2">Sipariş Durumu
                            </td>
                            <td class="priceS col-xs-1">Tutar
                            </td>
                            <td class="priceS col-xs-1">KDV
                            </td>
                            <td class="totalS col-xs-1">Toplam Tutar
                            </td>
                            <td class="name" style="border-right: none; width: 50px">Detay ve Kargo
                            </td>
                        </tr>
                    </thead>
                    <tbody>
                        @foreach (var item in Model.Orders)
                        {
                            <tr>
                                <td class="name">
                                    <a href="/Order/Detail/@item.OrderId">@item.OrderId</a>
                                    @if (@item.CanBeCancelled)
                                    {
                                        <br />
                                        <a href="/Order/Cancel/@item.OrderId" onclick="return confirm('Sipariş iptali yapılacak, devam etmek istiyor musunuz?')">İptal</a>
                                    }
                                </td>
                                <td class="name">
                                    @item.OrderDate
                                </td>
                                <td class="name">
                                    @item.ProductStatus
                                </td>
                                <td class="name">
                                    @item.StatusExplanation
                                </td>
                                <td class="priceS alignright">
                                    @item.Payment.ToString("###,###,##0.00 TL")
                                </td>
                                <td class="priceS alignright">
                                    @item.TaxTotal.ToString("###,###,##0.00 TL")
                                </td>
                                <td class="totalS alignright">
                                    @item.TotalPayment.ToString("###,###,##0.00 TL")
                                </td>
                                <td class="name" style="border-right: 0;">
                                    <a href="/Order/Detail/@item.OrderId">Sipariş Detayı</a>
                                </td>
                            </tr>
                        }
                    </tbody>
                </table>
            </div>
        </div>
    }
    else
    {
        <div class="bg-info bs-bgb" style="margin-bottom: 15px; color: #000000;">
            <span class="glyphicon glyphicon-info-sign"></span>&nbsp;Henüz hiç sipariş verilmemiş.
        </div>
    }
    @{Html.RenderAction("OurSuggestions", "Partials");}
</div>
